package cn.service.impl;

import cn.dao.OrdersDao;
import cn.entity.Orders;
import cn.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OrdersServiceImpl implements OrdersService{
	@Autowired
	OrdersDao ordersDao;
	@Override
	public int deleteByPrimaryKey(Object id) {
		return ordersDao.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Orders record) {
		return ordersDao.insert(record);
	}

	@Override
	public Orders selectByPrimaryKey(Object id) {
		return ordersDao.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKey(Orders record) {
		return ordersDao.updateByPrimaryKey(record);
	}

	@Override
	public List<Orders> find(Integer uid) {
		List<Orders> list=new ArrayList<Orders>();
		try{
			Map<String, Object> params=new HashMap<String, Object>();
			params.put("uid", uid);
			list=ordersDao.find(params);
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return list;
	}

	@Override
	public int getMaxId() {
		return ordersDao.getMaxId();
	}



	
	
}
